using log4net;
using ShaoLuCommonLibrary;
using ShaoLuNettyServer;
using System.Windows.Forms;

[assembly: log4net.Config.XmlConfigurator(Watch = true)]
namespace ShaoLuWinFormsApp
{
    public static class Program
    {
        private static readonly log4net.ILog Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

        /// <summary>
        ///  The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            // To customize application configuration such as set high DPI settings or default font,
            // see https://aka.ms/applicationconfiguration.
            ApplicationConfiguration.Initialize();
            LanguageHelper.SetLocalClutrue("en-US");
            
            Thread th = new Thread(() =>
            {
                try
                {
                    TcpServer server = TcpServer.getInstance();
                    server.Start().Wait();
                }
                catch (AggregateException ee)
                {
                    Logger.Error(ee);
                }
            });
            th.Start();


            //Application.Run(new LoginForm());
            Application.Run(new UartSettingForm());
        }
    }
}